package org.nanotek.dao.impl;

import java.io.Serializable;
import java.util.List;

import javax.ejb.Stateless;

import org.nanotek.beans.ArtistCredit;
import org.nanotek.beans.ArtistName;
import org.nanotek.dao.ArtistCreditDAO;

@SuppressWarnings({"serial","unchecked"})
@Stateless
public class ArtistCreditDAOImpl  extends LocalBaseDAO<ArtistCredit>  implements ArtistCreditDAO<ArtistCredit>{

	@Override
	public ArtistCredit findArtistCreditByArtistCreditId(Long artistCreditId) {
		return (ArtistCredit) em.createNamedQuery("FindArtistCreditById").setParameter("artistCreditId", artistCreditId).getSingleResult();
	}

	@Override
	public List<ArtistCredit> loadAll() {
		return em.createNamedQuery("ArtistCreditLoadAll").getResultList();
	}

	@Override
	public List<ArtistCredit> listRecords(Integer firstResult,
			Integer maxResults) {
		return em.createNamedQuery("ArtistCreditLoadAll").setFirstResult(firstResult).setMaxResults(maxResults).getResultList();
	}

	@Override
	public  <T extends Serializable> ArtistCredit find(T id) {
		return em.find(ArtistCredit.class , id);
	}

}
